<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<%@ include file="/web/header.jsp" %>
<title>Insert title here</title>
</head>
<body>
<fieldset class="layui-elem-field" style='margin:30px;padding:30px'>
	<legend>修改用户信息</legend>
	<div class="layui-field-box">
		<form class="layui-form-pane layui-form" lay-filter="formA">
			<div class="layui-form-item">
				<label class="layui-form-label">用户帐号</label>
				<div class="layui-input-inline">
					<input class="layui-input" name="code" type="text" placeholder="请输入用户帐号"
					required lay-verify="required" autocomplete="off" readonly>
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">密码</label>
				<div class="layui-input-inline">
					<input class="layui-input" name="pass" type="password" placeholder="请输入密码"
					 autocomplete="off" />
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-input-inline">
					
					<input type="button" value="确定" class="layui-btn" lay-submit lay-filter="updPas" />
					<input type="button" value="重置" class="layui-btn layui-btn-primary" onclick="init()" />			
				</div>
				<input type="button" value="重置密码" class="layui-btn" lay-submit lay-filter="resetPas" />
				<input type="button" value="关闭" class="layui-btn" onclick="toClose()"/>
			</div>
		</form>
	</div>
</fieldset>
<script type="text/javascript">
form.render();
init();
	function init(){	//回显
		var code = '<%=request.getParameter("code") %>'
			ajax({code:code},'/user/get.do','json',function(data){
				form.val("formA",data)
			})
	}
	
	formOn('submit(updPas)','/user/updPas.do','text',function(data){
		if(1==data){
			layer.msg("修改成功",toClose)
		}else{
			layer.msg("修改失败")
		}
	})
	
	formOn('submit(resetPas)','/user/resetPas.do','text',function(data){
		if(1==data){
			layer.msg("完成重置，密码为：123456",toClose)
		}else{
			layer.msg("密码重置失败")
		}
	})
</script>
</body>
</html>